A drilling rig is a machine used to create holes in the ground for the extraction of natural resources such as oil, gas, or minerals. It consists of various components including a drill bit, derrick, and power systems, and is often used in both onshore and offshore drilling operations.